﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using _300Report.Annotations;


namespace _300Report.domain
{
    class Role :INotifyPropertyChanged
    {

        /// <summary>
        ///      RoleName   string  // 角色名
        ///      RoleLevel  uint    // 角等级
        ///      JumpValue  int     // 节操值
        ///      WinCount   uint    // 胜场数
        ///      MatchCount uint    // 总场数
        ///      UpdateTime string  // 更新日期
        /// </summary>
        public string RoleName { get; set; } 
        public int RoleLevel { get; set; } 
        public int JumpValue { get; set; }
        public int WinCount { get; set; }
        public int MatchCount { get; set; }

        private string _roleEffficient = "加载中";//战斗力

        public string RoleEffficient
        {
            get
            {
                return _roleEffficient;
            }
            set
            {
                _roleEffficient = value;
                OnPropertyChanged("RoleEffficient");
            }
        } 
        public string UpdateTime { get; set; }

        private String _winPercent;

        public string WinPercent
        {
            get { return _winPercent; }
            set
            {
                _winPercent = value;
                OnPropertyChanged("WinPercent");
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }


        protected bool SetProperty<T>(ref T storage, T value, [CallerMemberName] String propertyName = null)
        {
            if (object.Equals(storage, value)) return false;
            storage = value;
            this.OnPropertyChanged(propertyName);
            return true;
        }
    }
}
